from django.db import models

# Create your models here.
class FileUploader(models.Model):
    file = models.FileField(upload_to='%Y%m%d')
    name = models.CharField(max_length=50, blank=True, null=True)
    upload_date = models.DateTimeField(auto_now=True, db_index=True)
    json_file = models.CharField(max_length=100, null=True, blank=True)
    excel_file = models.CharField(max_length=100, null=True, blank=True)

    class Meta:
        ordering = ['-upload_date']

    def __str__(self):
        return self.file.name
